<?xml version="1.0"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html><head><title>com.sekati.validate.CreditCardValidation - SASAPI</title><script src="../../../quicknav.js" type="text/javascript"></script><script><!--
document.quicknavBasePath="../../../index-files";
//--></script><link href="../../../style.css" title="JavaDoc" rel="stylesheet" type="text/css"/><link href="../../../unnatural.css" title="Unnatural" rel="alternate stylesheet" type="text/css"/><link href="../../../overview-summary.html" title="Overview" rel="top"/><link href="package-summary.html" title="Package com.sekati.validate" rel="up"/><link href="../../../com/sekati/validate/FlashValidation.html" title="Class com.sekati.validate.FlashValidation" rel="prev"/><link href="../../../com/sekati/utils/TextUtils.html" title="Class com.sekati.utils.TextUtils" rel="next"/><meta name="generator" content="http://www.badgers-in-foil.co.uk/projects/as2api/"/></head><body><h1>Class com.sekati.validate.CreditCardValidation</h1><div class="type_hierachy"><ul><li><strong>com.sekati.validate.CreditCardValidation</strong></li></ul></div><div class="type_description"><h2>Description</h2><p>
 Credit Card Validation class
 </p><h4>See Also</h4><ul class="extra_info"><li> <a href="../../../com/sekati/crypt/Luhn.html" class="class_name" title="Class com.sekati.crypt.Luhn">Luhn</a>
 </li></ul></div><div class="type_indexes"><div class="method_index"><h2>Method Index</h2><a href="#EncodeNumber" title="static public function EncodeNumber(strNumber:String, nDigitsShown:Number, strCharacter:String):String">EncodeNumber()</a>, <a href="#isValidExDate" title="static public function isValidExDate(nMonth:Number, nYear:Number):Boolean">isValidExDate()</a>, <a href="#isValidNumber" title="static public function isValidNumber(strNumber:String):Boolean">isValidNumber()</a></div></div><div class="type_details"><div class="method_detail_list"><h2>Method Detail</h2><div class="method_details alt_row"><a name="isValidExDate"></a><h3>isValidExDate</h3><code class="method_synopsis">static public function <strong class="method_name">isValidExDate</strong>(nMonth:<span class="unresolved_type_name">Number</span>, nYear:<span class="unresolved_type_name">Number</span>):<span class="unresolved_type_name">Boolean</span></code><div class="method_info"><p>
 validate a credit card expiration date
 </p><h4>Parameters</h4><table class="arguments extra_info" summary=""><tr><td><code>nMonth</code></td><td>(Number)
 </td></tr><tr><td><code>nYear</code></td><td>(Number)
 </td></tr></table><h4>Return</h4><p class="extra_info"> Boolean
 <pre> Usage:
 	<span class="key">var</span> isValidDate:Boolean = CreditCardValidation.isValidExDate(<span class="num_const">11</span>,<span class="num_const">2010</span>);
 </pre>
	 </p></div></div><div class="method_details"><a name="isValidNumber"></a><h3>isValidNumber</h3><code class="method_synopsis">static public function <strong class="method_name">isValidNumber</strong>(strNumber:<span class="unresolved_type_name">String</span>):<span class="unresolved_type_name">Boolean</span></code><div class="method_info"><p>
 validate a credit card number as much as possible before submitting for approval
 </p><h4>Parameters</h4><table class="arguments extra_info" summary=""><tr><td><code>strNumber</code></td><td>(String) credit card number as string
 </td></tr></table><h4>Return</h4><p class="extra_info"> Boolean
 <code> <span class="key">var</span> isValidNumber:Boolean = CreditCardValidation(<span class="str_const">"1234567890123456"</span>); </code>
	 </p></div></div><div class="method_details alt_row"><a name="EncodeNumber"></a><h3>EncodeNumber</h3><code class="method_synopsis">static public function <strong class="method_name">EncodeNumber</strong>(strNumber:<span class="unresolved_type_name">String</span>, nDigitsShown:<span class="unresolved_type_name">Number</span>, strCharacter:<span class="unresolved_type_name">String</span>):<span class="unresolved_type_name">String</span></code><div class="method_info"><p>
 Encode a credit card number as a string and encode all digits except the last nDigitsShown
 </p><h4>Parameters</h4><table class="arguments extra_info" summary=""><tr><td><code>strNumber</code></td><td>(String) credit card number as string
 </td></tr><tr><td><code>nDigitsShown</code></td><td>(Number) display this many digits at the end of the card number for security purposes
 </td></tr><tr><td><code>strCharacter</code></td><td>(String) optional encoding character to use instead of default '*'
 </td></tr></table><h4>Return</h4><p class="extra_info"> String
 <pre> Usage:
 trace(CreditCardValidation.EncodeNumber(<span class="str_const">"1234567890123456"</span>)); <span class="comment">// ************3456</span>
 trace(CreditCardValidation.EncodeNumber(<span class="str_const">"1234567890123456"</span>, <span class="num_const">5</span>, <span class="str_const">"x"</span>));  <span class="comment">// xxxxxxxxxxx23456</span>
 </pre>
	 </p></div></div></div></div><ul class="main_nav" id="main_nav"><li><a href="../../../overview-summary.html" title="Overview of SASAPI" class="button">Overview</a></li><li><a href="package-summary.html" title="Overview of package com.sekati.validate" class="button">Package</a></li><li><span class="button nav_current">Class</span></li><li><a href="CreditCardValidation.as.html" title="Source code of com.sekati.validate.CreditCardValidation" class="button">Source</a></li><li><a href="../../../index-files/index.html" title="Alpabetical index of types and members" class="button">Index</a></li></ul><div class="footer"><a href="http://www.badgers-in-foil.co.uk/projects/as2api/" title="ActionScript 2 API Documentation Generator">as2api</a></div></body></html>